package com.cn.controller;

import com.cn.service.ShopService.InventoryService;
import com.cn.service.VipcustomerService.VipService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/vip")

public class VipController {
    /**
     * 获取前端传来的CardID
     * 调取查询服务
     * 返回查询

     */
    @Autowired
    VipService vipService;
    @RequestMapping(value = "/search",method = RequestMethod.POST)
    @ResponseBody
    public void search(String Card_id){
        System.out.println(Card_id);
      /*  VipService vipService=new VipService();*/
        vipService.SearchvipByCartId(Card_id);

    }

    @RequestMapping(value = "/login" ,method = RequestMethod.POST)
    @ResponseBody
    public void login( @Param("Card_id") String Card_id){
 /*       VipService vipService=new VipService();*/
        vipService.loginVipByCardId(Card_id);
        System.out.println("校验成功！CartId="+Card_id);

    }
}
